<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

// 虚拟订单
class VirtualOrder extends Model
{
    use HasFactory;

    private $prefix = "primary";

    protected $table = "virtual_order";

    public function setGameArea($serverId)
    {
        if(!$serverId) $serverId = '0';
        if ($this->prefix!=='primary'){
            parent::setConnection( $this->prefix.'_'. $serverId);
        }
    }

}

